﻿namespace JelloPhysics
{
    using JelloPhysics;
    using Microsoft.Xna.Framework;
    using System;

    internal class FallingBody : PressureBody
    {
        public FallingBody(World w, ClosedShape s, float massPerPoint, float gasPressure, float shapeSpringK, float shapeSpringDamp, float edgeSpringK, float edgeSpringDamp, Vector2 pos, float angle, Vector2 scale) : base(w, s, massPerPoint, gasPressure, shapeSpringK, shapeSpringDamp, edgeSpringK, edgeSpringDamp, pos, angle, scale, false)
        {
        }

        public override void accumulateExternalForces()
        {
            base.accumulateExternalForces();
            for (int i = 0; i < base.mPointMasses.Count; i++)
            {
                PointMass local1 = base.mPointMasses[i];
                local1.Force += new Vector2(0f, -9.8f * base.mPointMasses[i].Mass);
            }
        }
    }
}

